load(
    "//bazel:tachyon_cc.bzl",
    "tachyon_cc_benchmark",
    "tachyon_cc_library",
    "tachyon_cc_unittest",
)

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "cost_calculator_forward",
    hdrs = ["cost_calculator_forward.h"],
)

tachyon_cc_library(
    name = "gmp_num_traits",
    hdrs = ["gmp_num_traits.h"],
    deps = [
        "@eigen_archive//:eigen3",
        "@local_config_gmp//:gmp",
    ],
)

tachyon_cc_library(
    name = "matrix_operations",
    hdrs = ["matrix_operations.h"],
    deps = [
        ":matrix_types",
        "//tachyon/base:openmp_util",
    ],
)

tachyon_cc_library(
    name = "matrix_types",
    hdrs = ["matrix_types.h"],
    deps = [
        ":prime_field_num_traits",
        "//tachyon/base:logging",
        "//tachyon/base/buffer:copyable",
        "//tachyon/math/finite_fields:finite_field_traits",
        "@eigen_archive//:eigen3",
    ],
)

tachyon_cc_library(
    name = "matrix_utils",
    hdrs = ["matrix_utils.h"],
    deps = [
        ":matrix_types",
        "//tachyon/base:bits",
        "//tachyon/base:compiler_specific",
        "//tachyon/base:openmp_util",
        "//tachyon/base:profiler",
        "//tachyon/base/containers:container_util",
        "//tachyon/math/finite_fields:extended_packed_field_traits_forward",
        "//tachyon/math/finite_fields:extension_field_traits_forward",
        "//tachyon/math/finite_fields:finite_field_traits",
        "//tachyon/math/finite_fields:packed_field_traits_forward",
        "@eigen_archive//:eigen3",
    ],
)

tachyon_cc_library(
    name = "prime_field_num_traits",
    hdrs = ["prime_field_num_traits.h"],
    deps = [
        ":cost_calculator_forward",
        "//tachyon/math/finite_fields:prime_field_base",
        "@eigen_archive//:eigen3",
    ],
)

tachyon_cc_unittest(
    name = "matrix_unittests",
    srcs = [
        "matrix_inverse_unittest.cc",
        "matrix_operations_unittest.cc",
        "matrix_types_unittest.cc",
        "matrix_utils_unittest.cc",
    ],
    deps = [
        ":matrix_operations",
        ":matrix_types",
        ":matrix_utils",
        "//tachyon/base/buffer:vector_buffer",
        "//tachyon/math/finite_fields/baby_bear:baby_bear4",
        "//tachyon/math/finite_fields/test:finite_field_test",
        "//tachyon/math/finite_fields/test:gf7",
    ],
)

tachyon_cc_benchmark(
    name = "matrix_operations_benchmark",
    srcs = ["matrix_operations_benchmark.cc"],
    deps = [
        ":matrix_operations",
        ":matrix_types",
        "//tachyon/math/elliptic_curves/bn/bn254:fr",
    ],
)
